﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="UploadFileControl.ascx.vb" Inherits="WebForm_CommonControl_UploadFileControl" %>

<script src="/VMS/js/JScript.js" type="text/javascript"></script>

<asp:Panel ID="panel1" runat="server" BackColor="white" BorderWidth="1" Style="cursor: move;" Width="700">
     <br />
    <div align="center">
        <asp:Label ID="lblTitle" runat="server" Text="<%$ Resources:Title %>" SkinID="title"></asp:Label>
    </div>
     <table width="100%">
         <tr>
             <td>
                 <table ID="table1" runat="server" border="0" style="width: 100%;">
                     <tr>
                         <td width="15%">
                             <asp:Label ID="Label1" runat="server" Text="<%$ Resources:File %>"></asp:Label>
                         </td>
                         <td>
                             <asp:FileUpload ID="hiFileUpload" runat="server" Width="70%" />
                             &nbsp;<asp:Button ID="Button1" runat="server" Text="<%$ Resources:Add %>" />
                         </td>
                     </tr>
                     <tr>
                         <td>
                             <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Desc %>"></asp:Label>
                         </td>
                         <td>
                             <asp:TextBox ID="txtDesc" runat="server" Rows="3" TextMode="MultiLine" 
                                 Width="95%"></asp:TextBox>
                         </td>
                     </tr>
                 </table>
             </td>
         </tr>
         <tr>
             <td>
                 
                 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                     DataKeyNames="FileSaveName" EmptyDataText="<%$ Resources:NoFiles %>" 
                     Width="100%" AllowPaging="True" AllowSorting="True">
                     <HeaderStyle Wrap="False" />
                     <AlternatingRowStyle BackColor="AliceBlue" />
                     <RowStyle BackColor="White" />
                     <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                     <Columns>
                         <asp:TemplateField ShowHeader="False">
                             <ItemTemplate>
                                 <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" 
                                     OnClick="lbtnDelete_Click" OnClientClick="<%$ Resources:DeleteConfirm %>" 
                                     Text="<%$ Resources:Delete %>" CommandName="Delete"></asp:LinkButton>
                             </ItemTemplate>
                             <ItemStyle HorizontalAlign="Center" />
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="<%$ Resources:File %>">
                             <ItemTemplate>
                                 <asp:LinkButton ID="lbtnDownLoadFile" runat="server" 
                                     OnClick="lbtnDownLoadFile_Click" Text='<%# Bind("FileName") %>'></asp:LinkButton>
                             </ItemTemplate>
                         </asp:TemplateField>
                         <asp:BoundField DataField="FileType" Visible="False" />
                         <asp:BoundField DataField="FileDesc" HeaderText="<%$ Resources:Desc %>" 
                             SortExpression="FileDesc" />
                     </Columns>
                 </asp:GridView>
                 <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                     DeleteMethod="BLL_Delete" InsertMethod="BLL_Insert" 
                     OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select" 
                     TypeName="BLL_Sys_UpLoadFiles">
                     <DeleteParameters>
                         <asp:Parameter Name="Original_FileSaveName" DbType="Guid" />
                     </DeleteParameters>
                     <SelectParameters>
                         <asp:Parameter Name="theClass" Type="String" />
                         <asp:Parameter Name="theType" Type="String" />
                     </SelectParameters>
                     <InsertParameters>
                         <asp:Parameter Name="theClass" Type="String" />
                         <asp:Parameter Name="theType" Type="String" />
                         <asp:Parameter Name="FileName" Type="String" />
                         <asp:Parameter Name="FileShortName" Type="String" />
                         <asp:Parameter Name="FileType" Type="String" />
                         <asp:Parameter Name="FileSavePath" Type="String" />
                         <asp:Parameter Name="FileSaveName" DbType="Guid" />
                         <asp:Parameter Name="FileDesc" Type="String" />
                         <asp:Parameter Name="CreateBy" Type="String" />
                     </InsertParameters>
                 </asp:ObjectDataSource>
             </td>
         </tr>
         <tr>
             <td align="center">
                 <asp:Button ID="btnOK" runat="server" Text="<%$ Resources:OK %>" />
             </td>
         </tr>
     </table>
   
    </asp:Panel>
<asp:Button ID="btnDummy" runat="server" Style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="mpUploadFile" runat="server" TargetControlID="btnDummy"
    PopupControlID="panel1"  OkControlID="btnOK" PopupDragHandleControlID="panel1" />